M

Your Notebook is now a Draft.

Once it's ready, please submit it for review by our team of Community Moderators. Thank you!

Pending

This content now needs to be approved by community moderators.

Submitted

This essay was submitted and is waiting for review.

News» {{qctrl.question.primary_project.name}}

Updates to Metaculus API

by christian {{qctrl.question.publish_time | dateStr}} Edited on {{qctrl.question.edited_time | dateStr}} {{"estimatedReadingTime" | translate:({minutes: qctrl.question.estimateReadingTime()})}}
  • Facebook
  • Twitter

  • This document is for you if you use the Metaculus API or if you have a Bot account linked to the AI Forecasting Benchmark Series.

    You may have heard: Soon we will launch a new version of the site as part of going open source! One of the improvements we’ve made is simplifying and reorganizing some of our GET responses. The only changes that should affect API users are to the Question endpoint. All POST endpoints and their associated request structures in the API remain the same. (Existing code that sends data to Metaculus should continue to function without modification.) We've updated the existing question endpoint to be forward-compatible. This means you can now test the new GET request format while still using the current (old) API, all before the new site is launched.

    If you’re a Forecasting Benchmark Series participant, we highly recommend this before the Q4 competition begins on October 8th!

    Highlights: Resolution criteria, fine print etc are nested under “question,” and aggregate predictions are nested under “question” > “aggregations”

    Below are the breaking changes to the Question endpoint, and in some cases suggestions for updates to your flow. Full documentation will be provided in the next few weeks.

    1. URL Construction:
      • Old: Used "page_url" directly
      • New: Construct using "id"
      • Update: Replace question['page_url'] with f"https://www.metaculus.com/questions/{question['id']}/"
    2. Author Information:
      • Old: "author", "author_name", "author_id"
      • New: "author_id", "author_username"
      • Update: Use question['author_username'] instead of question['author_name']
    3. Timestamps:
      • Old: "created_time", "publish_time", "close_time", "resolve_time"
      • New: "created_at", "published_at", "scheduled_close_time", "scheduled_resolve_time"
      • Update: Adjust all timestamp field names accordingly
    4. Question Status:
      • Old: "active_state"
      • New: "status"
      • Update: Map "RESOLVED" to "resolved", "OPEN" to "open", etc.
    5. User Permissions:
      • Old: Detailed "user_perms" object
      • New: Simple "user_permission" string
      • Update: Replace permission checks like if question['user_perms']['PREDICT'] with if question['user_permission'] == 'forecaster'
    6. Predictions:
      • Old: "community_prediction" and "metaculus_prediction"
      • New: Both are nested under "question" > "aggregations." Community prediction is now called "recency_weighted"
      • Update: Access predictions via question['question']['aggregations']
    7. Project Information:
      • Old: "projects" list with detailed info
      • New: "projects" object with "question_series" and "default_project"
      • Update: Adjust project data access accordingly
    8. Prediction Counts:
      • Old: "number_of_forecasters" and "prediction_count"
      • New: "nr_forecasters" and "forecasts_count"
      • Update: Adjust field names in code
    9. Resolution:
      • Old: "resolution" field (float)
      • New: Check "resolved" boolean and "question" > "resolution"
      • Update: Adjust resolution checking logic
    10. Description:
      • Old: "description" at the top level
      • New: Nested under "question"
      • Update: Access description directly with question['question']['description']
    11. Question Type:
      • Old: Under "possibilities" > "type"
      • New: Under "question" > "type"
      • Update: Change question['possibilities']['type'] to question['question']['type']

    Complete List of Removed Fields (requiring code updates if used):

    • "url", "page_url" (use "id" to construct)
    • "title_short"
    • "group_label"
    • "resolved_option"
    • "effected_close_time"
    • "scoring"
    • "weekly_movement", "weekly_movement_direction"
    • "cp_reveal_time"
    • "last_activity_time", "activity"
    • "approved_time", "approved_by_id"
    • "related_questions", "group", "condition", "unconditional_question"
    • "sub_questions", "total_sub_question_count"
    • "has_fan_graph"
    • "image_url"
    • "medals_end_year", "medals_duration"
    • "unweighted_community_prediction_v2", "recency_weighted_community_prediction_v2"
    • "cp_baseline_score", "cp_peer_score"

    You can email api-requests@metaculus.com if you have any issues with the API.

    Submit Essay

    Once you submit your essay, you can no longer edit it.